﻿using Entity.Core;
using FreeSql.DataAnnotations;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Entity.Core.Config
{
    /// <summary>
    /// 属性模式配置
    /// </summary>
    [JsonObject(MemberSerialization.OptIn), Table(Name = "property_pattern_config", DisableSyncStructure = true)]
    public class PropertyPatternConfigEntity: CommonBaseEntity
    {
        #region 配置键 通过该字段实例化到具体的类

        /// <summary>
        /// 配置键
        /// <para>数据库类型：varchar(256) ; 数据库值：不允许为空</para>
        /// <para>通过该字段实例化到具体的类</para>
        /// <para>数据库字段信息：key ,  varchar(256) ; </para>
        /// </summary>
        [JsonProperty("key)", Order = 1)]
        [Column(Name = "key", DbType = "varchar(256)")]
        [Display(Name = "配置键")]
        public string? @Key { get; set; }

        #endregion 配置键 通过该字段实例化到具体的类

        #region 配置名称

        /// <summary>
        /// 配置名称
        /// <para>数据库字段信息：name ,  varchar(90) ; </para>
        /// </summary>
        [JsonProperty("name)", Order = 2)]
        [Column(Name = "name", DbType = "varchar(90)")]
        [Display(Name = "配置名称")]
        public string? @Name { get; set; }

        #endregion 配置名称

        #region 配置分组键

        /// <summary>
        /// 配置分组键
        /// <para>数据库字段信息：group_key ,  varchar(256) ; </para>
        /// </summary>
        [JsonProperty("group_key)", Order = 3)]
        [Column(Name = "group_key", DbType = "varchar(256)")]
        [Display(Name = "配置分组键")]
        public string? @GroupKey { get; set; }

        #endregion 配置分组键

        #region 配置分组名称

        /// <summary>
        /// 配置分组名称
        /// <para>数据库字段信息：group_name ,  varchar(90) ; </para>
        /// </summary>
        [JsonProperty("group_name)", Order = 4)]
        [Column(Name = "group_name", DbType = "varchar(90)")]
        [Display(Name = "配置分组名称")]
        public string? @GroupName { get; set; }

        #endregion 配置分组名称

        #region 配置说明

        /// <summary>
        /// 配置说明
        /// <para>数据库字段信息：description ,  varchar(900) ; </para>
        /// </summary>
        [JsonProperty("description)", Order = 5)]
        [Column(Name = "description", DbType = "varchar(900)")]
        [Display(Name = "配置说明")]
        public string? @Description { get; set; }

        #endregion 配置说明

        #region 配置类型 加载配置的实体类类型

        /// <summary>
        /// 配置类型
        /// <para>数据库类型：varchar(256)</para>
        /// <para>加载配置的实体类类型</para>
        /// <para>数据库字段信息：config_type ,  varchar(256) ; </para>
        /// </summary>
        [JsonProperty("config_type)", Order = 6)]
        [Column(Name = "config_type", DbType = "varchar(256)")]
        [Display(Name = "配置类型")]
        public string? @ConfigType { get; set; }

        #endregion 配置类型 加载配置的实体类类型

        #region 是否启用 0:否;1:是

        /// <summary>
        /// 是否启用
        /// <para>数据库类型：tinyint ; 数据库默认值：1 ; 数据库值：不允许为空</para>
        /// <para>0:否;1:是</para>
        /// <para>数据库字段信息：is_enabled ,  tinyint ; </para>
        /// </summary>
        [JsonProperty("is_enabled)", Order = 7)]
        [Column(Name = "is_enabled", DbType = "tinyint")]
        [Display(Name = "是否启用")]
        public bool? @IsEnabled { get; set; } = true;

        #endregion 是否启用 0:否;1:是

        #region 是否显示 0:否;1:是

        /// <summary>
        /// 是否显示
        /// <para>数据库类型：tinyint ; 数据库默认值：1 ; 数据库值：不允许为空</para>
        /// <para>0:否;1:是</para>
        /// <para>数据库字段信息：is_visible ,  tinyint ; </para>
        /// </summary>
        [JsonProperty("is_visible)", Order = 8)]
        [Column(Name = "is_visible", DbType = "tinyint")]
        [Display(Name = "是否显示")]
        public bool? @IsVisible { get; set; } = true;

        #endregion 是否显示 0:否;1:是
    }
}
